#include "biblereaderxreflistdlg.h"

BibleReaderXrefListDlg::BibleReaderXrefListDlg()
{
    xrefArea = nullptr;
    buildLayout();
}

BibleReaderXrefListDlg::~BibleReaderXrefListDlg()
{
    if (xrefArea) {
        delete xrefArea;
    }
}

void BibleReaderXrefListDlg::setXrefStr(QString &xrefString)
{
    xrefStr = xrefString;
    xrefArea->setHtml(xrefStr);
}

void BibleReaderXrefListDlg::buildLayout()
{
    // set dialog size
    setMinimumSize(480, 320);
    if (!xrefArea) {
        xrefArea = new QTextBrowser(this);
        xrefArea->setFontPointSize(14);
    }

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setContentsMargins(0,0,0,0);
    layout->addWidget(xrefArea);

    setLayout(layout);
}
